#!/usr/env/bin python
# -*- coding: utf-8 -*-

# @Time    : 2020/3/19 16:09|16:09
# @Author  : yangdingyi
# @File    : date-test
# @Software: PyCharm

import datetime
import calendar


def next_next_first(date):
    now_month_days = calendar.monthrange(year=date.year, month=date.month)[1]
    print(f'-当月天数:{now_month_days}')

    last_day = datetime.datetime(year=date.year, month=date.month, day=now_month_days)
    print(f'-当月最后一天:{last_day}')

    next_month_first = last_day + datetime.timedelta(days=1)
    print(f'-下个月第一天:{next_month_first}')

    next_month_days = calendar.monthrange(year=next_month_first.year, month=next_month_first.month)[1]
    print(f'-下个月天数:{next_month_days}')

    next_month_last = datetime.datetime(
        year=next_month_first.year,
        month=next_month_first.month,
        day=next_month_days
    )
    print(f'-下个月最后一天:{next_month_last}')

    next_next_month_first = next_month_last + datetime.timedelta(days=1)
    print(f'-下下个月第一天:{next_next_month_first}')
    return next_next_month_first


now = datetime.datetime.now()
print(now)
print(next_next_first(now))

date_2019_12_3 = datetime.datetime(year=2019, month=12, day=3)
print(date_2019_12_3)
print(next_next_first(date_2019_12_3))

date_2020_1_1 = datetime.datetime(year=2020, month=1, day=1)
print(date_2020_1_1)
print(next_next_first(date_2020_1_1))
